/*
 * @Author: LuZeng
 * @Date: 2022-07-29 17:25:14
 * @LastEditTime: 2022-08-28 22:04:29
 * @LastEditors: LuZeng
 * @Description: 小白本白，写的不好多多包涵！！！
 * @FilePath: \jsd:\rjiananzhuang\WEB\WEB workspace\实训三\练习\ThreeNode\Moon Painting\app\router.js
 * 别乱动！
 */
// app/router.js
"use strict";

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = (app) => {
  const { router, controller, jwt } = app;

  router.get("/", controller.home.index);
  // 登录
  router.post("/logon", controller.logon.logon);
  // 1查询所有学生信息
  router.get("/student", jwt, controller.student.findAll); // 新增
  // 2根据id查询学生信息;
  router.get("/student/findById", jwt, controller.student.findById);
  // 3查询所有商品信息
  router.get("/products/findAll", jwt, controller.findProducts.findAllProducts);
  // 4根据商品分类查询商品信息
  router.get("/products/findName", jwt, controller.findProducts.findByName);
  // 5根据商品id查询商品信息
  router.get("/products/findId", jwt, controller.findProducts.findById);
  // 6更新购物车数据信息
  router.get("/shopping/update", jwt, controller.shopping.addCommodity);
  // 7查询所有订单信息
  router.get("/order/findAll", jwt, controller.order.getAllOrder);
  // 8添加购物车
  router.get("/shopping/addCart", jwt, controller.shopping.addShoppingCart);
  // 9查询购物车信息
  router.get("/order/findCart", jwt, controller.order.getCartList);
  // 10删除购物车商品
  router.get("/order/delete", jwt, controller.order.deleteCartProduct);
  // 11查询个人信息
  router.get("/mine/findOwn", jwt, controller.mine.getOwnData);
  // 12确认收货
  router.get("/order/confirm", jwt, controller.order.confirm);
  // 13查询已完成订单
  router.get("/order/completed", jwt, controller.order.getCompleted);
  // 14更新自己更改后的信息
  router.get("/mine/updateOwnData", jwt, controller.mine.updateOwnData);
  // 15注册新用户
  router.post("/user/register", controller.logon.register);
  // 16删除订单信息
  router.get("/order/deleteCompleted", jwt, controller.order.deleteCompleted);
  router.get("/student/lists", controller.student.lists); // 新增
};
